/*     */ package com.kingdee.eas.lifetime.util.kdcontrolutils;
/*     */ 
/*     */ import com.kingdee.bos.ui.face.IUIFactory;
/*     */ import com.kingdee.bos.ui.face.IUIWindow;
/*     */ import com.kingdee.bos.ui.face.UIException;
/*     */ import com.kingdee.bos.ui.face.UIFactory;
/*     */ import com.kingdee.eas.common.client.UIContext;
/*     */ import com.kingdee.eas.common.client.UIFactoryName;
/*     */ import com.kingdee.eas.util.client.ComponentUtil;
/*     */ import java.awt.Dimension;
/*     */ import java.awt.Insets;
/*     */ import java.awt.Rectangle;
/*     */ import java.awt.Toolkit;
/*     */ import java.awt.Window;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class EDwindowUtil
/*     */ {
/*     */   public static IUIWindow getWindow(Object obj, String windowName, String windowState)
/*     */   {
/*  40 */     IUIWindow myWindow = null;
/*  41 */     Map map = new UIContext(obj);
/*     */     try {
/*  43 */       myWindow = UIFactory.createUIFactory(UIFactoryName.MODEL).create(windowName, map, null, windowState);
/*     */     } catch (UIException e) {
/*  45 */       e.printStackTrace();
/*     */     }
/*  47 */     return myWindow;
/*     */   }
/*     */ 
/*     */   public static IUIWindow getWindow(Map uiContent, String windowName, String windowState)
/*     */   {
/*  62 */     IUIWindow myWindow = null;
/*     */     try {
/*  64 */       myWindow = UIFactory.createUIFactory(UIFactoryName.MODEL).create(windowName, uiContent, null, windowState);
/*     */     } catch (UIException e) {
/*  66 */       e.printStackTrace();
/*     */     }
/*  68 */     return myWindow;
/*     */   }
/*     */ 
/*     */   public static IUIWindow getWindow(Map uiContext, String windowName) {
/*  72 */     return getWindow(uiContext, windowName, null);
/*     */   }
/*     */ 
/*     */   public static IUIWindow getWindow(String uiFactoryName, Map uiContent, String windowName, String windowState)
/*     */   {
/*  90 */     IUIWindow myWindow = null;
/*     */     try {
/*  92 */       myWindow = UIFactory.createUIFactory(uiFactoryName).create(windowName, uiContent, null, windowState);
/*     */     } catch (UIException e) {
/*  94 */       e.printStackTrace();
/*     */     }
/*  96 */     return myWindow;
/*     */   }
/*     */ 
/*     */   public static class ResizeWindowSize
/*     */   {
/*     */     Window dialog_;
/*     */     Rectangle winSize;
/* 108 */     public static ResizeWindowSize instance = new ResizeWindowSize();
/*     */ 
/*     */     public void toMax()
/*     */     {
/* 117 */       this.dialog_ = ComponentUtil.getOwnerWindow(null);
/* 118 */       this.winSize = this.dialog_.getBounds();
/* 119 */       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
/* 120 */       Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(this.dialog_.getGraphicsConfiguration());
/* 121 */       Rectangle desktopBounds = new Rectangle(screenInsets.left, screenInsets.top, screenSize.width - screenInsets.left - screenInsets.right, screenSize.height - 
/* 122 */         screenInsets.top - screenInsets.bottom);
/* 123 */       this.dialog_.setBounds(0, 0, desktopBounds.width, desktopBounds.height);
/*     */     }
/*     */ 
/*     */     public void resume()
/*     */     {
/* 130 */       this.dialog_.setBounds(this.winSize);
/*     */     }
/*     */   }
/*     */ }

/* Location:           D:\work\kingdee\enable\富国基金\fuguo_lib.jar
 * Qualified Name:     com.kingdee.eas.lifetime.util.kdcontrolutils.EDwindowUtil
 * JD-Core Version:    0.6.0
 */